-- FETCH_SIN_COTTAGE_GOODS

-- 抽取原罪小屋的商品
-- @param user 玩家对象
return function(user)
    -- 一件固定
    local ret = {};
    table.insert(ret, { ["goodsId"] = 1101, });

    -- 三选一
    local rand = DungeonM.getRandSeed("FETCH_SIN_COTTAGE_GOODS");
    local group1 = { 1102, 1103, 1103, 1108, }
    local index = rand % #group1 + 1;  -- 注意：客户端的下标比服务器大1
    local id = group1[index];

    table.insert(ret, { ["goodsId"] = id, });

    -- 四选二，暗影石10个后不再出
    local group2 = {};
    if 10 <= DungeonServiceM.getItemStat(7244) then
        group2 = { 1105, 1106, 1107, };
    else
        group2 = { 1104, 1105, 1106, 1107, };
    end
    
    for i = 1, 2 do
        rand = DungeonM.getRandSeed("FETCH_SIN_COTTAGE_GOODS");
        index = rand % #group2 + 1;  -- 注意：客户端的下标比服务器大1
        id = group2[index];
        table.insert(ret, { ["goodsId"] = id, });

        -- 已选过的要移除
        table.removeItem(group2, id);
    end

    return ret;
end